package com.tcm.invite.mapper;

import com.tcm.invite.domain.entity.InviteRecord;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface InviteRecordMapper {

    int insert(InviteRecord record);

    InviteRecord findById(Long id);

    int update(InviteRecord record);

    List<InviteRecord> queryInviteRecordPage(@Param("cellphone")String cellphone,
                                                @Param("spreadType")String spreadType,
                                                @Param("page")Long page,
                                                @Param("pagesize")Long pagesize);

    Long countBySpreadType(@Param("cellphone")String cellphone, @Param("spreadType")String spreadType);

    InviteRecord findByInvitedCode(@Param("invitedCode") String invitedCode , @Param("spreadType") String spreadType);

    InviteRecord findBothInvite(@Param("cellphone") String cellphone, @Param("invitedCode")String invitedCode);

    List<InviteRecord> findByPhone(@Param("cellphone") String cellphone, @Param("spreadType") String spreadType);
}